package cn.nbs.admin.dao;

import java.sql.SQLException;

import org.apache.commons.dbutils.handlers.BeanHandler;

import cn.com.hkr.jdbc.TxQueryRunner;
import cn.nbs.admin.entity.Admin;

public class AdminDao {

	private TxQueryRunner qr = new TxQueryRunner();
	
	public Admin findNameAndPwd(String adminname, String adminpwd) {
		String sql = "select * from t_admin where adminname = ? and adminpwd = ?";
		try {
			return qr.query(sql, new BeanHandler<Admin>(Admin.class),adminname,adminpwd);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}

}
